/* 优化后的表格样式 - 增强版 - 简化设计，提高内容可读性 */

/* ============================================================================ 
   基础表格样式优化
   ============================================================================ */

/* 表格容器样式优化 - 增强选择器特异性 */
.app-container .table-container,
.app-container .performance-table-container,
.app-container .advanced-table-container {
    flex: 1 !important;
    overflow: auto !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e0e0e0 !important;
    width: 100% !important;
    min-height: 400px !important;
    height: 100% !important;
}

/* 收益分析表格容器特殊处理 - 支持水平滚动 */
.app-container .performance-table-container {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 300px) !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

/* 表格信息显示 */
.table-info {
    padding: 10px 15px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    font-size: 0.9em !important;
    color: #6c757d !important;
}

.table-info p {
    margin: 0 !important;
}

/* 基础表格样式简化 - 增强选择器特异性 */
.table-container .results-table,
.performance-table-container .performance-table,
.advanced-table-container .advanced-results-table {
    width: 100% !important;
    border-collapse: collapse !important;
    display: table !important;
    table-layout: auto !important;
}

/* 收益分析表格特殊处理 - 设置最小宽度 */
.performance-table-container .performance-table {
    min-width: 1400px !important;
    white-space: nowrap !important;
}

/* 表头样式简化 - 增强选择器特异性 */
.results-table thead,
.performance-table thead,
.advanced-table-container thead {
    background: #f8f9fa !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.results-table th,
.performance-table th,
.advanced-table-container th {
    padding: 14px !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 0.9em !important;
    border-bottom: 2px solid #e9ecef !important;
    white-space: nowrap !important;
    background: #f8f9fa !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-radius: 0 !important;
}

/* 表格内容样式优化 - 增强选择器特异性 */
.results-table td,
.performance-table td,
.advanced-table-container td {
    padding: 12px 14px !important;
    border-bottom: 1px solid #e9ecef !important;
    color: #495057 !important;
    font-weight: normal !important;
    vertical-align: middle !important;
    min-height: 52px !important;
    height: auto !important;
}

/* 简化表格行悬停效果 - 增强选择器特异性 */
.results-table tbody tr:hover,
.performance-table tbody tr:hover,
.advanced-table-container tbody tr:hover {
    background: #f8f9fa !important;
    transform: none !important;
    box-shadow: none !important;
}

/* 表格行高度设置 */
.results-table tbody tr,
.performance-table tbody tr,
.advanced-table-container tbody tr {
    min-height: 52px !important;
    height: auto !important;
}

/* 数据导入页面表格样式 - 与收益分析表格保持一致 */
.import-page .performance-table tbody tr {
    min-height: 52px !important;
}

.import-page .performance-table td {
    padding: 12px 14px !important;
    min-height: 52px !important;
}

.import-page .performance-table th {
    padding: 14px !important;
}

/* 确保表格内容区域填充容器 - 增强选择器特异性 */
.results-table tbody,
.performance-table tbody,
.advanced-table-container tbody {
    display: table-row-group !important;
    width: 100% !important;
}

/* 表格最后一行去掉底边框 - 增强选择器特异性 */
.results-table tbody tr:last-child td,
.performance-table tbody tr:last-child td,
.advanced-table-container tbody tr:last-child td {
    border-bottom: none !important;
}

/* ============================================================================ 
   专业版页面表格优化
   ============================================================================ */

/* 专业版页面表格列宽度优化 - 增强选择器特异性 */
.advanced-results-table th:nth-child(1),
.advanced-results-table td:nth-child(1) {
    width: 80px !important;
    min-width: 80px !important;
}

.advanced-results-table th:nth-child(2),
.advanced-results-table td:nth-child(2) {
    width: 100px !important;
    min-width: 100px !important;
}

.advanced-results-table th:nth-child(3),
.advanced-results-table td:nth-child(3) {
    width: 120px !important;
    min-width: 120px !important;
}

.advanced-results-table th:nth-child(4),
.advanced-results-table td:nth-child(4) {
    width: 80px !important;
    min-width: 80px !important;
}

.advanced-results-table th:nth-child(5),
.advanced-results-table td:nth-child(5) {
    width: 80px !important;
    min-width: 80px !important;
}

.advanced-results-table th:nth-child(6),
.advanced-results-table td:nth-child(6) {
    width: 100px !important;
    min-width: 100px !important;
}

.advanced-results-table th:nth-child(7),
.advanced-results-table td:nth-child(7) {
    width: 100px !important;
    min-width: 100px !important;
}

/* ============================================================================ 
   收益分析页面表格优化
   ============================================================================ */

/* 收益分析页面表格列宽度优化 - 增强选择器特异性 */
.performance-table th,
.performance-table td {
    padding: 12px 10px !important;
}

.performance-table th:nth-child(1),
.performance-table td:nth-child(1) {
    width: 120px !important;
    min-width: 120px !important;
}

.performance-table th:nth-child(2),
.performance-table td:nth-child(2) {
    width: 120px !important;
    min-width: 120px !important;
}

.performance-table th:nth-child(3),
.performance-table td:nth-child(3) {
    width: 150px !important;
    min-width: 150px !important;
}

.performance-table th:nth-child(4),
.performance-table td:nth-child(4) {
    width: 140px !important;
    min-width: 140px !important;
}

.performance-table th:nth-child(5),
.performance-table td:nth-child(5) {
    width: 120px !important;
    min-width: 120px !important;
    text-align: right !important;
}

.performance-table th:nth-child(6),
.performance-table td:nth-child(6) {
    width: 120px !important;
    min-width: 120px !important;
    text-align: right !important;
}

.performance-table th:nth-child(7),
.performance-table td:nth-child(7) {
    width: 120px !important;
    min-width: 120px !important;
    text-align: right !important;
    font-weight: 600 !important;
}

.performance-table th:nth-child(8),
.performance-table td:nth-child(8) {
    width: 100px !important;
    min-width: 100px !important;
    text-align: center !important;
}

.performance-table th:nth-child(9),
.performance-table td:nth-child(9) {
    width: 120px !important;
    min-width: 120px !important;
    text-align: center !important;
}

.performance-table th:nth-child(10),
.performance-table td:nth-child(10) {
    width: 100px !important;
    min-width: 100px !important;
    text-align: center !important;
}

.performance-table th:nth-child(11),
.performance-table td:nth-child(11) {
    width: 100px !important;
    min-width: 100px !important;
    text-align: center !important;
}

.performance-table th:nth-child(12),
.performance-table td:nth-child(12) {
    width: 100px !important;
    min-width: 100px !important;
    text-align: center !important;
}

.performance-table th:nth-child(13),
.performance-table td:nth-child(13) {
    width: 100px !important;
    min-width: 100px !important;
    text-align: center !important;
}

.performance-table th:nth-child(14),
.performance-table td:nth-child(14) {
    width: 120px !important;
    min-width: 120px !important;
    text-align: center !important;
}

/* 数据导入页面表格列宽度优化 - 与收益分析表格样式统一 */
.import-page .performance-table th:nth-child(1),
.import-page .performance-table td:nth-child(1) {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

.import-page .performance-table th:nth-child(2),
.import-page .performance-table td:nth-child(2) {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}

.import-page .performance-table th:nth-child(3),
.import-page .performance-table td:nth-child(3) {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.import-page .performance-table th:nth-child(4),
.import-page .performance-table td:nth-child(4) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: right !important;
}

.import-page .performance-table th:nth-child(5),
.import-page .performance-table td:nth-child(5) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center !important;
}

.import-page .performance-table th:nth-child(6),
.import-page .performance-table td:nth-child(6) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center !important;
}

/* 简化收益率正负数样式 - 增强选择器特异性 */
.result.return_rate.positive {
    color: #e53935 !important;
}

.result.return_rate.negative {
    color: #2e7d32 !important;
}

/* 简化导入状态标签样式 - 增强选择器特异性 */
.import-count {
    font-weight: 500 !important;
    color: #495057 !important;
}

.import-count.status-success {
    color: #495057 !important;
    font-weight: 600 !important;
}

.import-count.status-warning {
    color: #495057 !important;
    font-weight: 600 !important;
}

.import-count.status-error {
    color: #495057 !important;
    font-weight: 600 !important;
}

/* ============================================================================ 
   状态徽章简化
   ============================================================================ */

/* 简化状态徽章样式 - 增强选择器特异性 */
.status-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8em !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
}

.status-badge.success,
.status-badge.warning,
.status-badge.error {
    background: #f8f9fa !important;
    color: #495057 !important;
    border-color: #dee2e6 !important;
}

/* 简化文件类型标签 - 增强选择器特异性 */
.type-badge {
    display: inline-block !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 0.8em !important;
    font-weight: 500 !important;
    text-align: center !important;
    min-width: 60px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
}

.type-hsnapshot,
.type-block,
.type-blockinfo,
.type-fboard,
.type-unknown {
    background: #f8f9fa !important;
    color: #495057 !important;
    border-color: #dee2e6 !important;
}

/* 数据导入页面文件类型列样式 */
.import-page .performance-table td:nth-child(3) {
    text-align: center !important;
    font-weight: 500 !important;
}

/* 数据导入页面按钮样式 - 与收益分析表格保持一致 */
.import-page .performance-table .btn-success {
    background: #28a745 !important;
    border: none !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.import-page .performance-table .btn-success:hover {
    background: #218838 !important;
}

.import-page .performance-table .btn-success:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
}

/* ============================================================================ 
   响应式设计优化
   ============================================================================ */

/* 大屏幕响应式优化 */
@media (max-width: 1200px) {
    /* 表格容器自适应 */
    .app-container .table-container,
    .app-container .performance-table-container,
    .app-container .advanced-table-container {
        width: 100% !important;
    }
    
    /* 表格列宽度进一步优化 */
    .performance-table th,
    .performance-table td {
        padding: 10px 8px !important;
        font-size: 0.85em !important;
    }
    
    .performance-table th:nth-child(1),
    .performance-table td:nth-child(1) {
        width: 100px !important;
        min-width: 100px !important;
    }
    
    .performance-table th:nth-child(2),
    .performance-table td:nth-child(2) {
        width: 100px !important;
        min-width: 100px !important;
    }
    
    .performance-table th:nth-child(3),
    .performance-table td:nth-child(3) {
        width: 120px !important;
        min-width: 120px !important;
    }
    
    /* 数据导入页面响应式列宽 */
    .import-page .performance-table th:nth-child(2),
    .import-page .performance-table td:nth-child(2) {
        width: 200px !important;
        min-width: 200px !important;
    }
}

/* 平板和移动端响应式优化 */
@media (max-width: 768px) {
    /* 表格适应小屏幕 */
    .app-container .table-container,
    .app-container .performance-table-container {
        border-radius: 4px !important;
    }
    
    /* 表头样式适应小屏幕 */
    .results-table th,
    .performance-table th {
        padding: 10px 6px !important;
        font-size: 0.8em !important;
    }
    
    /* 表格内容适应小屏幕 */
    .results-table td,
    .performance-table td {
        padding: 8px 6px !important;
        font-size: 0.8em !important;
    }
}